#include <bits/stdc++.h>
using namespace std;
#define int unsigned long long
int qpow(int a,int n)
{
    int ret=1;
    while(n)
    {
        if(n&1)ret*=a;
        a*=a;
        n>>=1;
    }
    return ret;
}
void solve()
{
    int n,m;
    cin>>n>>m;
    int x=qpow(10,m),y=1,z;
    for(int i=1;i<=n;i++)
    {
        cin>>z;
        if((x%z==0&&y>=x/z)||y>x/z)y=1;
        else y*=z;
    }
    cout<<y;
}
signed main()
{
    //ios::sync_with_stdio(false);
    //cin.tie(nullptr);
    int T=1;
    //cin>>T;
    while(T--)
    {
       solve();
    }
    return 0;
}